package cn.com.dhcc.ddi.task.vo.wapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.com.dhcc.app.core.handler.dbhandler.WappedResultSet;
import cn.com.dhcc.ddi.task.vo.Task;


public class TaskRowWapper implements RowMapper<Task>{

	@Override
	public Task mapRow(ResultSet rss, int rowNum) throws SQLException {
		WappedResultSet rs = new WappedResultSet(rss);
		Task vo = new Task();
		
		vo.setId(rs.getString("id"));
		vo.setMpId(rs.getString("mp_id"));
		vo.setTaskName(rs.getString("task_name"));
		vo.setStatus(rs.getString("status"));
		vo.setTaskFreqType(rs.getString("task_freq_type"));
		vo.setDateCategoryId(rs.getString("date_category_id"));
		vo.setExtrStartTime(rs.getTimestamp("extr_start_time"));
		vo.setExtrEndTime(rs.getTimestamp("extr_end_time"));
		vo.setIsAtomicity(rs.getString("isAtomicity"));
		vo.setMtime(rs.getTimestamp("mtime"));
		vo.setCount(rs.getString("count"));
		vo.setExecuteBeginTime(rs.getTimestamp("execute_begin_time"));
		vo.setExecuteEndTime(rs.getTimestamp("execute_end_time"));
		vo.setFreq(rs.getString("freq"));
		vo.setIntervalVallue(rs.getString("interval_vallue"));
		vo.setSuccessCount(rs.getString("successCount"));
		vo.setExecuteType(rs.getString("execute_type"));
		vo.setLastLogStatus(rs.getString("LOG_STATUS"));
		vo.setExecuteTime(rs.getString("EXECUTE_TIME"));
		vo.setHour(rs.getString("hour"));
		vo.setSum(rs.getString("sum"));
		return vo;
	}

}
